<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
    var app ="__CONTROLLER__";
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>导航菜单管理列表</title>
<link href="__ADMIN_PUBLIC__css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__ADMIN_PUBLIC__js/jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){
  // $(".click").click(function(){
  // $(".tip").fadeIn(200);
  // });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});



});
</script>


</head>


<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="{:U('Member/Index/welcome/')}">首页</a></li>
    <li><a href="{:U('Member/wmenu/index/')}">自定义菜单管理</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
        <li class="click">
        	<a href="{:U('Member/wmenu/add')}"><span><img src="__ADMIN_PUBLIC__images/t01.png" /></span>添加自定义菜单</a>
        </li>
        <li class="click">
        	<a href="javascript:del(0)"><span><img src="__ADMIN_PUBLIC__images/t03.png" /></span>删除公众号菜单</a>
        </li>

        </ul>
        
        
        <ul class="toolbar1">       
        </ul>
    
    </div>
    
    
    <table class="tablelist">
    	<thead>
    	<tr>
        <th>编号<i class="sort"><img src="__ADMIN_PUBLIC__images/px.gif" /></i></th>
        <th>标题</th>
        <th>关键字</th>
        <th>网址</th>
        <th>类型</th>
        <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="menuList" item="v" >
        <tr>
        <td>{$v.id}</td>
        <td>{$v._name}</td>
        <td>{$v.wxnkeyword}</td>
        <td>{$v.wxnurl}</td>
        <td><if condition="$v.nopen==0 ">_self<else />_blank</if></td>
        <td> <a href="{:U('edit',array('nid'=>$v['id']))}" class="tablelink">修改</a>  <a href="javascript:del('{$v.id}');" class="tablelink">删除</a>   </td>
        </tr> 
        </foreach>
       
        
        </tbody>
    </table>
    
   <div id="tab1" class="tabson">   
    <ul class="forminfo">
    <li><label>&nbsp;</label><input name="" type="button" class="btn createMenu" value="生成菜单"/></li>
    </ul> 
 	</div>
    
    <div class="tip">
    	<div class="tiptop"><span>提示信息</span><a></a></div>
        
      <div class="tipinfo">
        <span><img src="__ADMIN_PUBLIC__images/ticon.png" /></span>
        <div class="tipright">
        <p>是否确认删除 ？</p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
        </div>
        
        <div class="tipbtn">
        <input name="" type="button"  class="sure" value="确定" />&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    
    </div>
    
    
    
    
    </div>
    
    <script type="text/javascript">
    /**
     * 生成菜单
     */
    $('.createMenu').click(function(){
        <?php $uid = $_SESSION['uid'];?>
    	location.href="{:U('Admin/wmenu/CreateMenu',array('uid'=>$uid))}";
    })
    //记录删除状态
    var d =0;
    $(".tablelink").click(function(){
    	d = 1;
    })
    $(".click").click(function(){
    	d = 0;
    })
    //删除提示
	$('.tablelist tbody tr:odd').addClass('odd');
      //删除提示
      function del(name){
         $(".tip").fadeIn(200); 
         if(d == 1){
         	$('.sure').click(function(){
                var url = "{:U('Admin/wmenu/del',array('id'=> ''))}" + name;
	            location.href= "{:U('Admin/wmenu/del',array('id'=> ''))}" + name;
	            $(".tip").fadeOut(200); 
	         })
         }else{
         	$('.sure').click(function(){
	            location.href= "{:U('Admin/wmenu/delMenu')}";
	            $(".tip").fadeOut(200); 
	         })
         }
      }
	</script>

</body>

</html>
